#include <lib.h>
#define dfs_list_files _dfs_list_files
#include <dfs.h>
#include <string.h>
#include <stdio.h>
#include <limits.h>
/*
 * Implementation of the library function for
 * the _dfs_list_files system call
 */

#if _ANSI
PUBLIC int dfs_list_files(char *res)
#else
PUBLIC int dfs_list_files(res)
char *res
#endif
{
	message m;
	char files[BUFFER_SIZE];
	int r;
	/* set buffer */
	memset(files,0,BUFFER_SIZE);
	m.FILES = files;
	r = _syscall(DFS,DFS_GET_LFI,&m);
	
	if (r != OK) return (ERROR);
	/* after syscopy */
	sprintf(res,"%s",files);
	return OK;
}